#ifndef __JASONACTIONTURN_H__
#define __JASONACTIONTURN_H__

#include "JasonAction.h"

#include "ros/ros.h"
#include "std_msgs/String.h"
#include "nav_msgs/Odometry.h"
#include "jason_msgs/event.h"
#include "jason_msgs/action.h"

#include <tf/transform_broadcaster.h>
#include <tf/transform_datatypes.h>


class CJasonActionTurn : public CJasonAction {

    public:
        
        enum E_Orientation {
            
            Clockwise,
            Anticlockwise
        };
    
    protected:
        
        ros::NodeHandle &               m_rNode;
        ros::Publisher                  m_oCmdvelPub;
        ros::Publisher                  m_oEventPub;
        ros::Subscriber                 m_oOdomSub;

        geometry_msgs::Twist            m_oMsg;
        
        bool                            m_bnHasInitialAngle;
        float                           m_fInitialAngle;
        float                           m_fAngle;
        
        unsigned int                    m_wwId;
        std::string                     m_strAction;
        std::string                     m_strAgent;
        E_Orientation                   m_eOrientation;
        
    private:
        
        const float     GetAngle        ( const geometry_msgs::Quaternion & );
    
    public:
        
        CJasonActionTurn( ros::NodeHandle &, E_Orientation eOrientation, const jason_msgs::action::ConstPtr& );
        virtual ~CJasonActionTurn();
        
        virtual void    Step            ( void );
        virtual void    Start           ( void );
        
        void            ReceiveOdometry ( const nav_msgs::Odometry::ConstPtr& );
};


#endif //__JASONACTIONTURN_H__
